/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author FIRE
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';
import { BasCusKpinfo } from '../../bas/cus/basCusKpinfo';

const { ctxPath, adminPath } = useGlobSetting();

export interface CusFpApply extends BasicModel<CusFpApply> {
  cusCode?: string; // 客户编码
  isum?: number; // 申请金额
  kpStatus?: string; // 开票状态
  fpUrl?: string; // 发票链接
  overDate?: string; // 开票完成
  overBy?: string; // 开票人
  ctype?: string; // 抬头类型
  cname?: string; // 名称
  contactInfo?: string; // 联系方式
  dutyNo?: string; // 税号
  bankName?: string; // 开户银行
  bankCode?: string; // 银行帐号
  dwNo?: string; // 单位号码
  dwAddr?: string; // 单位地址
  isaleSum?: number; // 折扣额
  isaleRate?: number; // 折扣率
  iqty?: number; // 申请数量
  cusFpApplyRdsList?: any[]; // 子表列表
  kpInfo: BasCusKpinfo;
}

export const cusFpApplyList = (params?: CusFpApply | any) =>
  defHttp.get<CusFpApply>({ url: adminPath + '/shop/order/cusFpApply/list', params });

export const cusFpApplyListData = (params?: CusFpApply | any) =>
  defHttp.post<Page<CusFpApply>>({ url: adminPath + '/shop/order/cusFpApply/listData', params });

export const cusFpApplyKpListData = (params?: CusFpApply | any) =>
  defHttp.post<Page<CusFpApply>>({ url: adminPath + '/shop/order/cusFpApply/kpListData', params });

export const cusFpApplyForm = (params?: CusFpApply | any) =>
  defHttp.get<CusFpApply>({ url: adminPath + '/shop/order/cusFpApply/form', params });

export const cusFpApplySave = (params?: any, data?: CusFpApply | any) =>
  defHttp.postJson<CusFpApply>({ url: adminPath + '/shop/order/cusFpApply/save', params, data });

export const cusFpApplyAddToSel = (params?: any, data?: CusFpApply | any) =>
  defHttp.postJson<CusFpApply>({ url: adminPath + '/shop/order/cusFpApply/add2Sel', params, data });

export const cusFpApplyImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/shop/order/cusFpApply/importData',
      onUploadProgress,
    },
    params,
  );

export const cusFpApplyDelete = (params?: CusFpApply | any) =>
  defHttp.get<CusFpApply>({ url: adminPath + '/shop/order/cusFpApply/delete', params });


export const cusFpApplyComfirmSel = (params?: CusFpApply | any) =>
  defHttp.postJson<Page<CusFpApply>>({ url: adminPath + '/shop/order/cusFpApply/comfirmSel', params });
  

export const cusFpApplyChildList = (params?: CusFpApply | any) =>
  defHttp.get<CusFpApply>({ url: adminPath + '/shop/order/cusFpApply/childList', params });

export const cusFpApplyChildSumList = (params?: CusFpApply | any) =>
  defHttp.get<CusFpApply>({ url: adminPath + '/shop/order/cusFpApply/childSumList', params });

export const cusFpApplyaddRow = (params?: CusFpApply | any) =>
  defHttp.post<Page<CusFpApply>>({ url: adminPath + '/shop/order/cusFpApply/addRow', params });

export const cusFpApplydelRow = (params?: CusFpApply | any) =>
  defHttp.post<Page<CusFpApply>>({ url: adminPath + '/shop/order/cusFpApply/delRow', params });

export const cusFpApplyeditRow = (params?: CusFpApply | any,data?: CusFpApply | any) =>
  defHttp.postJson<Page<CusFpApply>>({ url: adminPath + '/shop/order/cusFpApply/editRow', params,data, });

  export const cusFpApplychildForm = (params?: CusFpApply | any) =>
  defHttp.get<CusFpApply>({ url: adminPath + '/shop/order/cusFpApply/childForm', params });